package cn.knightzz.mapper;

import cn.knightzz.entity.SysPopulation;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author knightzz
 * @since 2021-05-09
 */
public interface SysPopulationMapper extends BaseMapper<SysPopulation> {

    /**
     * 当前用户为管理员时进行分组查询
     * @param page
     * @param query
     * @param area
     * @return
     */
    IPage<SysPopulation> selectByAdmin(Page<?> page, String query,String area);

    /**
     * 当前用户是网格员或者其他用户时
     * @param page
     * @param query
     * @param area
     * @param authorId
     * @return
     */
    IPage<SysPopulation> selectByOther(Page<?> page, String query,String area, Long authorId);

    List<SysPopulation> getPopulationByAreaLikeAddress(String area, String query);
}
